Extension point datasources
In component org.nuxeo.runtime.datasource
Documentation
Example contribution:
<datasource blockingTimeoutMillis="10000"
driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
maxPoolSize="20" minPoolSize="5" name="jdbc/foo">
<property name="url">jdbc:derby:/home/db;create=true
</property>
<property name="username">nuxeo</property>
<property name="password">nuxeo</property>
</datasource>
Or, for a XA datasource:
<datasource blockingTimeoutMillis="10000" maxPoolSize="20"
minPoolSize="5" name="jdbc/foo" xaDataSource="org.apache.derby.jdbc.EmbeddedXADataSource">
<property name="databaseName">/home/db</property>
<property name="createDatabase">create</property>
<property name="user">nuxeo</property>
<property name="password">nuxeo</property>
</datasource>
The allowed attributes of a datasource
element are:
- name the JNDI name (for instance jdbc/foo )
- driverClassName the JDBC driver class name (only for a non-XA datasource)
- xaDataSource the XA datasource class name (only for a XA datasource)
To configure the characteristics of the pool:
- maxPoolSize the maximum number of active connections
- minPoolSize the minimum number of idle connections
- blockingTimeoutMillis the maximum number of milliseconds to wait for a connection to be available, or -1 (the default) to wait indefinitely
- ... see org.apache.commons.dbcp.BasicDataSource setters for more.
To configure the datasource, individual property sub-elements must be used. For a non-XA datasource, url
, username
and password
are commonly used. For a XA datasource, the properties are done according to the JavaBean setters of the datasource, see the documentation for your JDBC driver for more.
Contribution Descriptors
- Class: org.nuxeo.runtime.datasource.DataSourceDescriptor
- Class: org.nuxeo.runtime.datasource.DataSourceLinkDescriptor
Existing Contributions
Contributions are presented in the same order as the registration order on this extension point. This order is displayed before the contribution name, in brackets.
-
<extension point="datasources" target="org.nuxeo.runtime.datasource"> <datasource accessToUnderlyingConnectionAllowed="true" activeTimeoutMinutes="5" blockingTimeoutMillis="1000" driverClassName="org.h2.Driver" idleTimeoutMinutes="5" maxPoolSize="100" minPoolSize="5" name="jdbc/nuxeo" password="********" sqlExceptionSorter="org.nuxeo.runtime.datasource.DatasourceExceptionSorter" url="jdbc:h2:/Users/arnaud/Nuxeo/distrib/nuxeo-server-tomcat-9.10/nxserver/data/h2/nuxeo;DB_CLOSE_ON_EXIT=false" username="sa" validationQuery=""/> <link global="jdbc/nuxeo" name="jdbc/NuxeoDS" type="javax.sql.DataSource"/> <link global="jdbc/nuxeo" name="jdbc/nxsqldirectory" type="javax.sql.DataSource"/> <link global="jdbc/nuxeo" name="jdbc/nxrelations-default-jena" type="javax.sql.DataSource"/> <link global="jdbc/nuxeo" name="jdbc/comment-relations" type="javax.sql.DataSource"/> <link global="jdbc/nuxeo" name="jdbc/nxaudit-logs" type="javax.sql.DataSource"/> <link global="jdbc/nuxeo" name="jdbc/nxjbpm" type="javax.sql.DataSource"/> <link global="jdbc/nuxeo" name="jdbc/placeful_service_ds" type="javax.sql.DataSource"/> <link global="jdbc/nuxeo" name="jdbc/nxwebwidgets" type="javax.sql.DataSource"/> <link global="jdbc/nuxeo" name="jdbc/nxuidsequencer" type="javax.sql.DataSource"/> <link global="jdbc/nuxeo" name="jdbc/repository_default" type="javax.sql.DataSource"/> </extension>